<?php

namespace App;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

/**
 * App\SystemGroup
 *
 * @property int $id
 * @property string $name 拼团活动名称
 * @property string|null $start_time 开始时间
 * @property string|null $end_time 结束时间
 * @property int $time_limit 成团时效
 * @property int $require_num 成团人数
 * @property string $activity_group 活动对象
 * @property int $status 状态
 * @property \Illuminate\Support\Carbon|null $deleted_at
 * @property \Illuminate\Support\Carbon|null $created_at
 * @property \Illuminate\Support\Carbon|null $updated_at
 * @method static bool|null forceDelete()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\SystemGroup newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\SystemGroup newQuery()
 * @method static \Illuminate\Database\Query\Builder|\App\SystemGroup onlyTrashed()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\SystemGroup query()
 * @method static bool|null restore()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\SystemGroup whereActivityGroup($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\SystemGroup whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\SystemGroup whereDeletedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\SystemGroup whereEndTime($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\SystemGroup whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\SystemGroup whereName($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\SystemGroup whereRequireNum($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\SystemGroup whereStartTime($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\SystemGroup whereStatus($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\SystemGroup whereTimeLimit($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\SystemGroup whereUpdatedAt($value)
 * @method static \Illuminate\Database\Query\Builder|\App\SystemGroup withTrashed()
 * @method static \Illuminate\Database\Query\Builder|\App\SystemGroup withoutTrashed()
 * @mixin \Eloquent
 */
class SystemGroup extends Model
{
    use SoftDeletes;
    public static function getTimeLimit($sysGroupId){
        $data = self::whereId($sysGroupId)->first();
        return $data ? $data->time_limit : 0;
    }
}
